<template>
    <div class="header">
      <div class="header-left">
        <span class="iconfont back-icon">&#xe624;</span>
      </div>
      <div class="header-input">
        <span class="iconfont">&#xe632;</span>
        输入城市/景点/游玩主题
      </div>
      <router-link :to="{path:'/city'}">
        <div class="header-right">
          <!--{{this.$store.state.city}}-->
          {{this.city}}
          <span class="iconfont arrow-icon">&#xe6bd;</span>
        </div>
      </router-link>
    </div>
</template>

<script>
import {mapState} from 'vuex'
export default {
  name: 'HomeHeader',
  props: {
    // city: String
  },
  computed: {
    ...mapState(['city'])
  }
}
</script>

<style lang="stylus" scoped>
/*设置html的font-size:50px; 1rem = 50px;
设计师设计的尺寸是2倍的移动端尺寸,比如86px,实际上在移动端显示的43px,因为放大了嘛
---------------------------------
-webkit-min-device-pixel-ratio: 2
不同手机的ideal viewport宽度是不一样的,
常见的有320px, 360px, 384px.
iphone系列的这个值在6之前都是320px,
---------------------------------
2.假如height:86px; 1rem = 100px;从而使得rem 与px之间是整倍数关系
  86px = .86rem;这就是为什么将字体设置为50px的原因
========================================================
CSS排版规范
1.box大小/margin/position
2.字体(line-height)/颜色/背景
3.动画效果(包含border-radius/shadow)
*/
@import '~styles/varibles.styl' // 在style中引用style 不能直接使用@,而要用 ~@
.header
  display: flex
  height: $headerHeight
  font-size:0.28rem
  color:#fff
  align-item:center
  line-height: $headerHeight
  background-color:$bgColor // 采用变量表示
  .header-left
    width: .64rem
    float: left
    .back-icon
      display:block
      text-align: center
      font-size: .4rem
  .header-input
    flex:auto
    color: #ccc
    line-height:.64rem
    background: #fff
    height: .64rem
    margin-top: .12rem
    margin-left: .2rem
    padding-left: .2rem
    border-radius: .1rem
    touch-action none
  .header-right
    float:right
    min-width:1.04rem
    padding 0 .1rem
    text-align:center
    color: #fff
    .arrow-icon
      margin-left: -.04rem
      font-size: .24rem
/*
.header {
  display:flex;
  height:.86rem;
  background-color:#7fdbff;
}
*/
</style>
